import type { AppRouteModule } from '/@/router/types';
import { RoleEnum } from '/@/enums/roleEnum';
import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';

const charts: AppRouteModule = {
  path: '/admin',
  name: 'Admin',
  component: LAYOUT,
  redirect: '/admin/administrationList',
  meta: {
    orderNo: 20,
    icon: 'ant-design:reddit-circle-filled',
    title: t('routes.demo.admin.adminTitle'),
    roles: [RoleEnum.ADMIN, RoleEnum.OTHER],
  },
  children: [
    {
      path: 'administrationList',
      name: 'AdministrationList',
      meta: {
        title: t('routes.demo.admin.administrationList'),
        roles: [RoleEnum.ADMIN, RoleEnum.OTHER],
      },
      component: () => import('/@/views/locality/admin/administrationList.vue'),
    },
    {
      path: 'menuAuthority',
      name: 'MenuAuthority',
      meta: {
        title: t('routes.demo.admin.menuAuthority'),
        roles: [RoleEnum.ADMIN, RoleEnum.OTHER],
      },
      component: () => import('/@/views/locality/admin/authority.vue'),
    },
    {
      path: 'buttonAuthority',
      name: 'ButtonAuthority',
      meta: {
        title: t('routes.demo.admin.buttonAuthority'),
        roles: [RoleEnum.ADMIN, RoleEnum.OTHER],
      },
      component: () => import('/@/views/locality/admin/buttonAuthority.vue'),
    },
    {
      path: 'otherType',
      name: 'OtherType',
      meta: {
        title: t('routes.demo.admin.otherType'),
        roles: [RoleEnum.ADMIN, RoleEnum.OTHER],
      },
      component: () => import('/@/views/locality/admin/otherType.vue'),
    },
  ],
};

export default charts;
